import request from '@/axios'
import { UserType } from './types'

//分页获取用户类型
export const pageApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/usertype/page', data })
}

//新增用户类型
export const addApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/usertype/add', data })
}
//获取用户类型
export const getApi = (params) => {
  return request.get({ url: '/rbac-server/rbac/usertype/get', params })
}
//删除用户类型
export const delApi = (id) => {
  return request.delete({ url: '/rbac-server/rbac/usertype/delete', params: { id } })
}
//修改用户类型
export const updateApi = (data) => {
  return request.put({ url: '/rbac-server/rbac/usertype/update', data })
}

//获取启用组织类型
export const listApi = (data): Promise<IResponse<UserType[]>> => {
  return request.post({ url: '/rbac-server/rbac/usertype/list', data })
}

//排序
export const sortApi = (params) => {
  return request.put({ url: '/rbac-server/rbac/usertype/sort', params })
}
